//
//  HttpRequest.h
//  XiaoHongShu
//
//  Created by Jason on 2022/6/18.
//

#import <AFNetworking/AFNetworking.h>

@class HttpResponseModel;

NS_ASSUME_NONNULL_BEGIN

@interface HttpRequest : AFHTTPSessionManager
//创建单例
+ (instancetype) shareInstance;

- (NSURLSessionDataTask *)post:(NSString *)urlString
                    parameters:(nullable id)parameters
                       success:(void (^)(NSURLSessionDataTask *task, HttpResponseModel * _Nullable responseModel))success
                       failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure;

- (NSURLSessionDataTask *)get:(NSString *)urlString parameters:(id)parameters success:(void (^)(NSURLSessionDataTask * _Nonnull, HttpResponseModel * _Nonnull))success failure:(void (^)(NSURLSessionDataTask * _Nonnull, NSError * _Nonnull))failure;

@end

NS_ASSUME_NONNULL_END
